const { ref } = Vue
import { useFetch } from '../../../Scripts/hooks/useFetch.js'

export function useCollectInfo() {
  const collectInfoList = ref([]);

  const getCollectInfo = async configObj => {
    const { data } = await useFetch({
      url: `${configObj.url}?actions=${configObj.method}`,
      data: {
        type: `${configObj.method}`,
        postData: configObj.postData
      }
    });
    collectInfoList.value = data.value;
  }

  return {
    collectInfoList, getCollectInfo
  }
}